﻿<%@ Page Title="Counterparties" Language="C#" MasterPageFile="~/Backoffice/BackOffice.Master"
    AutoEventWireup="true" CodeBehind="Counterparties.aspx.cs" Inherits="TreaShares.Backoffice.User.Counterparties" %>

<%@ MasterType VirtualPath="~/Backoffice/BackOffice.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1"
        AllowPaging="True" DataKeyNames="Id" GridLines="None">
        <Columns>
            <asp:BoundField DataField="ShortName" HeaderText="Short Name" />
            <asp:BoundField DataField="LongName" HeaderText="Long Name" />
            <asp:CheckBoxField DataField="IsActive" HeaderText="Is Active" />
            <asp:CheckBoxField DataField="IsInternal" HeaderText="Internal" />
            <asp:CheckBoxField DataField="optionPlan" HeaderText="Option Plan" />
            <asp:CommandField ShowEditButton="True" />
            <asp:TemplateField HeaderText="Delete" HeaderStyle-HorizontalAlign="Center">
                <ItemStyle HorizontalAlign="Center" />
                <ItemTemplate>
                    <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/Icons/trash.gif"
                        CommandName="Delete" OnClientClick="return confirm('Are you sure you want to delete')" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EmptyDataTemplate>
            No Records found
        </EmptyDataTemplate>
    </asp:GridView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="SelectAll"
        TypeName="TreaShares.Backoffice.Controlers.CounterpartyManager" UpdateMethod="Update"
        InsertMethod="InsertCounterParty" OnSelecting="ObjectDataSource1_Selecting" OnUpdating="ObjectDataSource1_Updating"
        OnInserting="ObjectDataSource1_Inserting" DeleteMethod="Delete">
        <SelectParameters>
            <asp:Parameter Name="ClientId" DbType="Guid" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="id" Type="Int32" />
            <asp:Parameter Name="shortName" Type="String" />
            <asp:Parameter Name="longName" Type="String" />
            <asp:Parameter Name="isActive" Type="Boolean" />
            <asp:Parameter Name="IsInternal" Type="Boolean" />
            <asp:Parameter Name="optionPlan" Type="Boolean" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="shortName" Type="String" />
            <asp:Parameter Name="longName" Type="String" />
            <asp:Parameter Name="isActive" Type="Boolean" />
            <asp:CookieParameter Name="clientId" CookieName="organisationId" Type="String" />
            <asp:Parameter Name="isInternal" Type="Boolean" />
            <asp:Parameter Name="optionPlan" Type="Boolean" />
        </InsertParameters>
        <DeleteParameters>
            <asp:Parameter Name="id" Type="Int32" />
        </DeleteParameters>
    </asp:ObjectDataSource>
    <br />
    <br />
    <asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="ObjectDataSource1"
        AutoGenerateRows="False" DataKeyNames="Id" DefaultMode="Insert" HeaderText="Insert new Counterparty"
        GridLines="None" AlternatingRowStyle-CssClass="AlternatingRow" HeaderStyle-CssClass="HeaderStyle">
        <AlternatingRowStyle CssClass="AlternatingRow"></AlternatingRowStyle>
        <Fields>
            <asp:BoundField HeaderText="Short Name" DataField="shortName" />
            <asp:BoundField HeaderText="Long Name" DataField="longName" />
            <asp:CheckBoxField HeaderText="Is Active" DataField="IsActive" />
            <asp:CheckBoxField HeaderText="Internal" DataField="isInternal" />
            <asp:CheckBoxField HeaderText="Option Plan" DataField="OptionPlan" />
            <asp:CommandField ShowInsertButton="True" ItemStyle-HorizontalAlign="Right" />
        </Fields>
        <HeaderStyle CssClass="HeaderStyle"></HeaderStyle>
    </asp:DetailsView>
</asp:Content>
